/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.core.service;

import com.intelligent.ispc.core.dto.RoleDto;
import com.intelligent.ispc.core.dto.UserDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * Created by Rovey on 2015/10/8.
 */
public interface UserService {

    void saveUser(UserDto userDto, String password);

    void updateUser(UserDto user);

    void deleteUser(String id);

    UserDto findById(String id);

    List<RoleDto> findUserCanAddRoles(String id);

    UserDto findByLoginName(String name);

    List<UserDto> findAllUsers();

    List<UserDto> searchUser(Map<String, Object> searchParams);

    Page<UserDto> searchUser(Map<String, Object> searchParams, Pageable pageRequest);

    Page<UserDto> searchUserByOrg(String orgName, Pageable pageable);

    void assignRolesForUser(String userId,List<String> roleIds);

    void deleteRolesForUser(String userId, List<String> roleIds);

    List<RoleDto> findUserHaveRole(String userId);

    void resetPassword(String userId);

    void updatePassword(String loginName, String password, String newPassword);
}
